from __future__ import annotations

from typing import List

from business_processes.opening_account_validation.domain.entity.package import AccountPackage
from core.presentation.response import BaseResponse
from core.domain.enums import PackageStatus
from pydantic import BaseModel


class PackageResult(BaseModel):
    package_uuid: str
    documents: List[str]
    package_status: PackageStatus

    @classmethod
    def from_entity(cls, account_package: AccountPackage) -> PackageResult:
        return cls(
            uuid=account_package.uuid,
            documents=account_package.documents,
            status=account_package.status,
        )


class AccountPackageResponse(BaseResponse):
    result: PackageResult
